<template>
    <env-monitor-common ref="refMonitorCommon" @getData="getData" />
</template>

<script setup>
import { ref } from "vue";
import EnvMonitorCommon from "../components/index.vue";
import { getNoiseStatistic, getNoiseGeoJson } from "@/api/biz/environmental-monitoring";

const refMonitorCommon = ref(null);

const getData = async () => {
    if (!refMonitorCommon.value) return;

    // 资源数据
    let targetObj = await refMonitorCommon.value.getAsyncCatchData(getNoiseStatistic);

    // 地图数据
    let geoJsonObj = await refMonitorCommon.value.getAsyncCatchData(getNoiseGeoJson);

    // 渲染页面
    refMonitorCommon.value.reGetData(targetObj, geoJsonObj);
};
</script>
